package com.coocare.licence.utils;

import java.util.Collection;

/**
 * @author adam
 * @date 21/12/16
 */
public class EmptyUtil {

    public static boolean isEmpty(Object objs) {
        return objs == null;
    }

    public static boolean isEmpty(Object[] objs) {
        return (objs == null) || (objs.length == 0);
    }

    public static boolean isEmpty(Collection<?> objs) {
        return (objs == null) || (objs.size() <= 0);
    }

    public static boolean isEmpty(byte[] objs) {
        return (objs == null) || (objs.length == 0);
    }

    public static boolean isEmpty(String str) {
        return (str == null) || (str.trim().length() == 0);
    }

    public static boolean isEmpty(Long l) {
        return (l == null) || (l == 0L);
    }

    public static boolean isEmpty(Integer objs) {
        return (objs == null) || (objs == 0);
    }

    public static boolean isNotEmpty(Object objs) {
        return !isEmpty(objs);
    }

    public static boolean isNotEmpty(Object[] objs) {
        return !isEmpty(objs);
    }

    public static boolean isNotEmpty(Collection<?> objs) {
        return !isEmpty(objs);
    }

    public static boolean isNotEmpty(byte[] objs) {
        return !isEmpty(objs);
    }

    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    public static boolean isNotEmpty(Long l) {
        return !isEmpty(l);
    }

    public static boolean isNotEmpty(Integer objs) {
        return !isEmpty(objs);
    }
}
